package com.gitee.feizns.quickstart.javacv;

import lombok.RequiredArgsConstructor;
import org.bytedeco.ffmpeg.global.avcodec;

/**
 * 音频类型
 * @author feizns
 * @since 2025/9/12
 */
@RequiredArgsConstructor
public enum AudioType {

    mp3("mp3", avcodec.AV_CODEC_ID_MP3, "audio/mpeg"),
    aac("adts", avcodec.AV_CODEC_ID_AAC, "audio/aac"),
    wav("wav", avcodec.AV_CODEC_ID_PCM_S16LE, "audio/wav"),
    flac("flac", avcodec.AV_CODEC_ID_FLAC, "audio/flac"),
    opus("opus", avcodec.AV_CODEC_ID_OPUS,   "audio/opus"),
    ogg("ogg", avcodec.AV_CODEC_ID_VORBIS, "audio/ogg"),
    mp4("ipod",   avcodec.AV_CODEC_ID_AAC,    "audio/mp4"),
    ac3("ac3",    avcodec.AV_CODEC_ID_AC3,    "audio/ac3"),
    amr("amr",    avcodec.AV_CODEC_ID_AMR_NB, "audio/amr");

    /**
     * format
     */
    private final String format;

    /**
     * 编 解码 器
     */
    private final int codec;

    /**
     * MIME 类型
     */
    private final String mimeType;

    /**
     * 格式
     * @return {@link String }
     */
    public String format() {
        return format;
    }

    /**
     * 编 解码 器
     * @return int
     */
    public int codec() {
        return codec;
    }

    /**
     * MIME 类型
     * @return {@link String }
     */
    public String mimeType() {
        return mimeType;
    }

}
